import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/index/Index.vue'
import PersonalHome from "@/components/PersonalCenter/PersonalHome"
import ArticleTxt from "@/components/release/articleTxt"
import Articles from "@/components/PersonalCenter/articles"
import Collections from "@/components/PersonalCenter/collections"
import Designs from "@/components/PersonalCenter/designs"
import Likes from "@/components/PersonalCenter/likes"
import Dynamic from "@/components/PersonalCenter/dynamic"
import Comments from "@/components/PersonalCenter/comments"
import ArticleDetail from "@/components/release/articleDetail"
import SetUp from "@/components/PersonalCenter/setup/setup"
import PersonalData from "@/components/PersonalCenter/setup/personalData"
import Account from "@/components/PersonalCenter/setup/account"
import ChangePw from "@/components/PersonalCenter/setup/changepw"
import ReleaseWork from "@/components/release/releaseWork"
import Design from "@/components/index/design"
import DesignDetail from "@/components/index/designDetail"
import Question from "@/components/index/question"
import QuestionDetail from "@/components/index/questionDetail"


Vue.use(Router)

export default new Router({
  
  routes: [
    {
      path: '/',
      redirect:'/index'
    },
    {
      path:'/index',
      name:'index',
      component:Index
    },
    {
      path:'/design',
      component:Design,
      children:[
        {
          path:"/design/designDetail/:id",
          name:'designDetail',
          component:DesignDetail
        },
      ]
    },
    {
      path:'/quesetion',
      name:'quesetion',
      component:Question 
    },
    {
      path:"/question/questionDetail/:id",
      component:QuestionDetail
    },
    {
      path:'/release/article/editor',
      name:'article',
      component:ArticleTxt
    },
    {
      path:'/release/work',
      component:ReleaseWork 
    },
    
    {
      path:"/articleDetail/:id",
      name:'articleDetail',
      component:ArticleDetail
    },
    {
      path:"/personal",
      name:'personal',
      component:PersonalHome,
      // 个人中心
      children:[
        {
          path:'/personal',
          redirect:'/personal/dynamic'
        },
        {
          path:"/personal/dynamic",
          component:Dynamic
        },
        {
          path:"/personal/articles",
          component:Articles
        },
        {
          path:"/personal/collections",
          component:Collections
        },
        {
          path:"/personal/designs",
          component:Designs
        },
        {
          path:"/personal/likes",
          component:Likes
        },
        {
          path:"/personal/comments",
          component:Comments
        },
      ]
    },
    {
      path:'/setup',
      component:SetUp,
      children:[
        {
          path:'/',
          redirect:'/setup/personalData'
        },
        {
          path:'/setup/personalData',
          component:PersonalData
        },
        {
          path:'/setup/account',
          component:Account
        },
        {
          path:'/setup/changepw',
          component:ChangePw
        }
      ]
    }
  ],

});
